<html>
<script language="javascript">
 function chkName(id) {
        alert('yes');
        var txtBoxElement = document.getElementById(id);
        if (txtBoxElement.value.length == 0) {
            alert('Blank Name Not Allowed!');
            return false;
        }
        else
            return true;
    }

function show()
{
   alert('Hello Java Script');
}
function show2()
{
   confirm('Are you sure?');
   return;
}
</script>
  <body onload='show()'>
    <font color='red'><b> Hello World</b> </font>
    <input type='button' name='btnshow' value='Show' onclick='show()'/>
    <input type='button' name='btnshow2' value='Show2' onclick='show2()'/>
   <asp:Button id="btn1" runat="server" text="show"/>

   Enter your name <input type='text' name='txtName' size='30' onblur="chkName('txtName')"> 
   <input type='button' name='btnChkName' value='Add Stud.' onclick="chkName('txtName')"/>
  </body>
</html>